<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('inspection_plans', function (Blueprint $table) {
            $table->comment('日常巡检计划');
            $table->bigIncrements('id')->comment('ID');
            $table->string('name', 64)->nullable(false)->comment('计划名称');
            $table->tinyInteger('cycle')->nullable(false)->comment('巡检周期 1每日、2每周、3每月');
            $table->json('person')->nullable(false)->comment('巡检人');
            $table->json('devices')->nullable(false)->comment('巡检设备');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('inspection_plans');
    }
};